﻿using MaxStoreErp.Core.BaseClasses;
using MaxStoreErp.Core.Commands;

namespace MaxStoreShop.Core.EditorBase
{
    public class EditorViewModelBase<T> : ViewModelBase where T: EntityBase 
    {
        T _selectedItem;
        bool _isCancelVisible;
        public RelayCommand CancelCommand { get; set; }
        public RelayCommand SaveCommand { get; set; }

        public T SelectedItem
        {
            get { return _selectedItem; }
            set { OnPropertyChanged(ref _selectedItem, value, "SelectedItem"); }
        }

        public bool IsCancelVisible
        {
            get { return _isCancelVisible; }
            set { OnPropertyChanged(ref _isCancelVisible, value, "IsCancelVisible"); }
        }
    }
}
